#pragma once
#include <vector>
#include <string>

struct GunAttachment {
	std::string key;
	double recoilCoefficient;
};

struct MovementParams {
	int interval;
	int distance;
};

class Gun
{
public:

	std::string name;

	double magnification = 1.0;

	int step;

	int interval;

	std::vector<int> offsetVector;

	std::vector<std::vector<MovementParams>> movements;
	std::vector<std::vector<MovementParams>> movementsLong;

	GunAttachment muzzle;

	GunAttachment grip;

	GunAttachment sight;

	GunAttachment butt;
public:
	Gun();
	Gun(std::string name,
		double magnification = 1.0,
		int step = 0,
		int interval = 0,
		std::vector<int> offsetVector = std::vector<int>(),
		GunAttachment muzzle = { "muzzle", 1.0 },
		GunAttachment grip = { "grip", 1.0 },
		GunAttachment sight = { "sight", 1.0 },
		GunAttachment butt = { "butt", 1.0 });
	~Gun();

	void computeMovements();

	bool gunIsSafe();

	double computeRecoil();

	void printInfo();
};
